<%--
  Created by IntelliJ IDEA.
  User: Tang'ya'kang
  Date: 2023/5/28
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>邮箱绑定/更换</title>
</head>
<%@ include file="head.jsp"%>
<body>
<div class="card">
    <h5 align="center">邮箱绑定/更换</h5>
    <div class="card-body">
        <c:if test="${empty sessionScope.User.email}">
            <form action="./emailServlet" method="post">
                <input type="hidden" name="action" value="EmailBind">
                <input type="hidden" name="user_name" value="${sessionScope.User.username}">
                <div class="form-group">
                    <label> 您还未绑定任何邮箱 </label><br/>
                    <label> 请输入需要绑定的邮箱 </label>
                    <input type="text" class="form-control" id="username" name="ToEmail">
                    <label> 邮箱绑定后不可修改，请谨慎绑定！ </label>
                </div>
                <button type="submit" class="btn btn-primary">确定</button>
                <label align-self="center"> <font color="red">${requestScope.status}</font></label>
            </form>
        </c:if>
        <c:if test="${not empty sessionScope.User.email}">
            <form action="#" method="post">
                <input type="hidden" name="action" value="EmailBind">
                <input type="hidden" name="user_name" value="${sessionScope.User.username}">
                <div class="form-group">
                    <label> 您已经绑定了邮箱：${sessionScope.User.email} </label><br/>
                    <label> 若您需要更换邮箱，则请与管理员联系 </label>
                </div>
            </form>
        </c:if>
    </div>
    <%@ include file="Foot.jsp"%>
</div>
</body>
</html>
